import 'package:flutter/material.dart';
import 'dart:math';

class PaintWidgetPage extends StatelessWidget {
  const PaintWidgetPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Custom Button Layout'),
      ),
      body: Center(
        child: CustomPaint(
          size: const Size(200, 200),
          painter: ButtonPainter(),
        ),
      ),
    );
  }
}

class ButtonPainter extends CustomPainter {

  @override
  void paint(Canvas canvas, Size size) {
    final double radius = size.width / 2;
    final double centerX = size.width / 2;
    final double centerY = size.height / 2;

    const double buttonRadius = 20;
    const double buttonSpacing = 20;

    final centerPaint = Paint()..color = Colors.red;
    canvas.drawCircle(Offset(centerX, centerY), radius, centerPaint);


    final paint = Paint()..color = Colors.blue;

    for (double angle = 0; angle < 2 * pi; angle += pi / 6) {
      final double x = centerX + (radius + buttonRadius + buttonSpacing) * cos(angle);
      final double y = centerY + (radius + buttonRadius + buttonSpacing) * sin(angle);

      canvas.drawCircle(Offset(x, y), buttonRadius, paint);
    }
  }

  @override
  bool shouldRepaint(CustomPainter oldDelegate) {
    return false;
  }
}
